<div class="row">
	<div class="col-lg-12">
		<h3><i class="fa fa-angle-right"></i> Cliente</h3>
	</div>
	<div class="col-lg-4 col-md-4 col-sm-4 mb">
		<div class="content-panel pn">
			<div id="spotify">
				<div class="col-xs-4 col-xs-offset-8">
					<button title="Hora de Atencion" class="btn btn-sm btn-clear-g"><?php echo date('H:i', strtotime($usuario['Usuario']['hora_atencion'])); ?> hrs.</button>
				</div>
				<div class="sp-title">
					<h3><?php echo h($usuario['Usuario']['username']); ?> <?php echo h($usuario['Usuario']['apellido']); ?></h3>
				</div>
			</div>
			<p class="followers"><i class="fa fa-mobile-phone"></i> <?php echo h($usuario['Usuario']['celular']); ?> / <i class="fa fa-envelope-o"></i> <a href="mailto:<?php echo h($usuario['Usuario']['correo']); ?>"><?php echo h($usuario['Usuario']['correo']); ?></a></p>
		</div>
	</div>
	<div class="col-lg-8 col-md-8 col-sm-8 mb">
		<div class="content-panel pn">
		<div class="row">
			<div class="col-lg-12">
				<h3>&nbsp;&nbsp;<i class="fa fa-angle-right"></i> Datos</h3>
			</div>
		</div>
			<div class="col-lg-3">
				<dl>
					<dt><?php echo __('Rut'); ?></dt>
					<dd>
						<?php echo ($usuario['Usuario']['rut'] != "")? $usuario['Usuario']['rut'] : "Dato no ingresado"; ?>
						&nbsp;
					</dd>
					<dt>Altura</dt>
					<dd>
						<?php echo ($usuario['Usuario']['altura'] != "")? $usuario['Usuario']['altura'] . " cms." : "Dato no ingresado"; ?>
						&nbsp;
					</dd>
					<dt>Peso</dt>
					<dd>
						<?php echo ($usuario['Usuario']['peso'] != "")? $usuario['Usuario']['peso']." k." : "Dato no ingresado";  ?>
						&nbsp;
					</dd>
					<dt><?php echo __('Fecha Nacimiento'); ?></dt>
					<dd>
						<?php echo ($usuario['Usuario']['fecha_nacimiento'] != "")? date('d-m-Y', strtotime($usuario['Usuario']['fecha_nacimiento'])) : "Dato no ingresado"; ?>
						&nbsp;
					</dd>
				</dl>
			</div>
			<div class="col-xs-9 hidden-xs hidden-sm hidden-md">
				<dl>
					<dt>Hora preferente atencion</dt>
					<dd>
						<?php echo date('H:i', strtotime($usuario['Usuario']['hora_atencion'])); ?> hrs.
						&nbsp;
					</dd>
					<dt>Celular</dt>
					<dd>
						<?php echo h($usuario['Usuario']['celular']); ?>
						&nbsp;
					</dd>
					<dt>Correo</dt>
					<dd>
						<a href="mailto:<?php echo h($usuario['Usuario']['correo']); ?>"><?php echo h($usuario['Usuario']['correo']); ?></a>
						&nbsp;
					</dd>
					<dt>Creado</dt>
					<dd>
						<?php echo date('d-m-Y H:i', strtotime($usuario['Usuario']['created'])). " hrs." ; ?>
						&nbsp;
					</dd>
				</dl>
			</div>
		</div>
	</div>
</div>





<div role="tabpanel">

  <!-- Nav tabs -->
  <ul class="nav nav-tabs" role="tablist">
    <li role="presentation" class="active"><a href="#alergias" aria-controls="alergias" role="tab" data-toggle="tab">Alergias</a></li>
    <li role="presentation"><a href="#horas" aria-controls="horas" role="tab" data-toggle="tab">Horas</a></li>
    <li role="presentation"><a href="#ventas" aria-controls="ventas" role="tab" data-toggle="tab">Ventas</a></li>
    <li role="presentation"><a href="#fotos" aria-controls="fotos" role="tab" data-toggle="tab">Fotos</a></li>
  </ul>

  <!-- Tab panes -->
  <div class="tab-content">
	<div role="tabpanel" class="tab-pane active" id="alergias">
		&nbsp;
		<?php if (!empty($usuario['Alergia'])): ?>
			<table class="table table-hover">
			<tr>
				<th><?php echo __('Id'); ?></th>
				<th><?php echo __('Nombre'); ?></th>
				<th class="actions"><?php echo __('Actions'); ?></th>
			</tr>
			<?php foreach ($usuario['Alergia'] as $alergia): ?>
				<tr>
					<td><?php echo $alergia['id']; ?></td>
					<td><?php echo $alergia['nombre']; ?></td>
					<td class="actions">
						<?php echo $this->Html->link(__('View'), array('controller' => 'alergias', 'action' => 'view', $alergia['id'])); ?>
						<?php echo $this->Html->link(__('Edit'), array('controller' => 'alergias', 'action' => 'edit', $alergia['id'])); ?>
						<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'alergias', 'action' => 'delete', $alergia['id']), array(), __('Are you sure you want to delete # %s?', $alergia['id'])); ?>
					</td>
				</tr>
			<?php endforeach; ?>
			</table>
		<?php else: ?>
			<h3><?php echo h($usuario['Usuario']['username']); ?> <?php echo h($usuario['Usuario']['apellido']); ?> no tiene o no ha registrado alergias</h3>
		<?php endif; ?>
		<?php echo $this->Html->link(__('New Alergia'), array('controller' => 'alergias', 'action' => 'add')); ?>
	</div>	
    <div role="tabpanel" class="tab-pane" id="horas">
		&nbsp;
		<?php if (!empty($usuario['Hora'])): ?>
			<table class="table table-hover">
			<tr>
				<th><?php echo __('Id'); ?></th>
				<th><?php echo __('Usuario Id'); ?></th>
				<th><?php echo __('Tratamiento Id'); ?></th>
				<th><?php echo __('Dia'); ?></th>
				<th><?php echo __('Detalle'); ?></th>
				<th><?php echo __('Created'); ?></th>
				<th><?php echo __('Modified'); ?></th>
				<th class="actions"><?php echo __('Actions'); ?></th>
			</tr>
			<?php foreach ($usuario['Hora'] as $hora): ?>
				<tr>
					<td><?php echo $hora['id']; ?></td>
					<td><?php echo $hora['usuario_id']; ?></td>
					<td><?php echo $hora['tratamiento_id']; ?></td>
					<td><?php echo $hora['dia']; ?></td>
					<td><?php echo $hora['detalle']; ?></td>
					<td><?php echo $hora['created']; ?></td>
					<td><?php echo $hora['modified']; ?></td>
					<td class="actions">
						<?php echo $this->Html->link(__('View'), array('controller' => 'horas', 'action' => 'view', $hora['id'])); ?>
						<?php echo $this->Html->link(__('Edit'), array('controller' => 'horas', 'action' => 'edit', $hora['id'])); ?>
						<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'horas', 'action' => 'delete', $hora['id']), array(), __('Are you sure you want to delete # %s?', $hora['id'])); ?>
					</td>
				</tr>
			<?php endforeach; ?>
			</table>
		<?php else: ?>
			<h3><?php echo h($usuario['Usuario']['username']); ?> <?php echo h($usuario['Usuario']['apellido']); ?> no registra horas de ventas</h3>
		<?php endif; ?>
		<?php echo $this->Html->link(__('New Hora'), array('controller' => 'horas', 'action' => 'add')); ?>
	</div>
	<div role="tabpanel" class="tab-pane" id="ventas">
    	&nbsp;
		<?php if (!empty($usuario['Venta'])): ?>
			<table class="table table-hover">
			<tr>
				<th><?php echo __('Id'); ?></th>
				<th><?php echo __('Usuario Id'); ?></th>
				<th><?php echo __('Monto'); ?></th>
				<th><?php echo __('Created'); ?></th>
				<th><?php echo __('Modified'); ?></th>
				<th class="actions"><?php echo __('Actions'); ?></th>
			</tr>
			<?php foreach ($usuario['Venta'] as $venta): ?>
				<tr>
					<td><?php echo $venta['id']; ?></td>
					<td><?php echo $venta['usuario_id']; ?></td>
					<td><?php echo $venta['monto']; ?></td>
					<td><?php echo $venta['created']; ?></td>
					<td><?php echo $venta['modified']; ?></td>
					<td class="actions">
						<?php echo $this->Html->link(__('View'), array('controller' => 'ventas', 'action' => 'view', $venta['id'])); ?>
						<?php echo $this->Html->link(__('Edit'), array('controller' => 'ventas', 'action' => 'edit', $venta['id'])); ?>
						<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'ventas', 'action' => 'delete', $venta['id']), array(), __('Are you sure you want to delete # %s?', $venta['id'])); ?>
					</td>
				</tr>
			<?php endforeach; ?>
			</table>
		<?php else: ?>
			<h3><?php echo h($usuario['Usuario']['username']); ?> <?php echo h($usuario['Usuario']['apellido']); ?> no ha comprado ningun tratamiento</h3>
		<?php endif; ?>
		<?php echo $this->Html->link(__('New Venta'), array('controller' => 'ventas', 'action' => 'add')); ?>
	</div>
	<div role="tabpanel" class="tab-pane" id="fotos">
		&nbsp;
		<?php if (!empty($usuario['Foto'])): ?>
			<table class="table table-hover">
			<tr>
				<th><?php echo __('Id'); ?></th>
				<th><?php echo __('Img'); ?></th>
				<th><?php echo __('Usuario Id'); ?></th>
				<th><?php echo __('Created'); ?></th>
				<th><?php echo __('Landscape'); ?></th>
				<th class="actions"><?php echo __('Actions'); ?></th>
			</tr>
			<?php foreach ($usuario['Foto'] as $foto): ?>
				<tr>
					<td><?php echo $foto['id']; ?></td>
					<td><?php echo $foto['img']; ?></td>
					<td><?php echo $foto['usuario_id']; ?></td>
					<td><?php echo $foto['created']; ?></td>
					<td><?php echo $foto['landscape']; ?></td>
					<td class="actions">
						<?php echo $this->Html->link(__('View'), array('controller' => 'fotos', 'action' => 'view', $foto['id'])); ?>
						<?php echo $this->Html->link(__('Edit'), array('controller' => 'fotos', 'action' => 'edit', $foto['id'])); ?>
						<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'fotos', 'action' => 'delete', $foto['id']), array(), __('Are you sure you want to delete # %s?', $foto['id'])); ?>
					</td>
				</tr>
			<?php endforeach; ?>
			</table>
		<?php else: ?>
			<h3><?php echo h($usuario['Usuario']['username']); ?> <?php echo h($usuario['Usuario']['apellido']); ?> no tiene imagenes</h3>
		<?php endif; ?>
		<?php echo $this->Html->link(__('New Foto'), array('controller' => 'fotos', 'action' => 'add')); ?>
	</div>
  </div>
</div>
